<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
  if($_FILES['flash']['name']!=""){
    $now = time();
    /*  while(file_exists($nombre_archivo = $uploadsDirectory.$now.'-'.$_FILES['flash']['name'])) {
         $now++;
     }*/
     if (move_uploaded_file($_FILES['flash']['tmp_name'], "images/static/publicidad.swf")){
       echo "<script> ";
       echo "function fon(){alert(\"El archivo ha sido cargado correctamente.\");";
       echo  "document.location.href=\"admin.php\"  ;}";
       echo " fon(); ";
       echo "</script>";
     }else{
       echo "<script> ";
       echo "function fon2(){alert(\"Error al subir imagen\");";
       echo  "document.location.href=\"admin.php\"  ;}";
       echo " fon2(); ";
       echo "</script>";
     }
  }
?>
